<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title> 登录</title>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/js/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="/js/easyui/datagrid-detailview.js"></script>
    <script type="text/javascript" src="/js/petecat.js"></script>
     <script type="text/javascript" src="/js/jquery.cookie.js"></script>
    <link rel="stylesheet" type="text/css" href="/css/main.css"></link>
    <link rel="stylesheet" type="text/css" href="/css/themes/default/easyui.css"></link>
	<link rel="stylesheet" type="text/css" href="/css/themes/icon.css"></link>
	<link rel="stylesheet" type="text/css" href="/css/themes/color.css"></link>
    <script>
        if(window.top!==window.self){window.top.location=window.location};
    </script>

</head>
<body>
<script type="text/javascript">
    $(document).ready(function(){
        $('#login-window').window({
            //可伸缩箭头
            collapsible:false,
            // 最小化
            minimizable:false,
            // 最大化
            maximizable:false,
            //调整窗口大小
            resizable:false, 
            //拖拽操作
            draggable:true,
            //关闭按钮
            closable:false
        });
    });
    document.onkeydown = function(e){
        var event = e || window.event;  
        var code = event.keyCode || event.which || event.charCode;
        if (code == 13) {
            login();
        }
    }
    $(function(){
        $("input[name='login']").focus();
    });
    function cleardata(){
        $('#loginForm').form('clear');
    }
    function login(){
    	if(!$("#loginForm").form('validate')){
    		return;
    	}
   	    var jsonuserinfo = serializeForm("#loginForm");  
	    var req = {useToken:false};
		req['reqJSON'] = {
			url:  SSO_URL+'user/ssoLogin',
			type:'post',
			data:JSON.stringify(jsonuserinfo)
		};
		req['successFn'] = function(respData){
				if(respData.code == SUCCESS_CODE){
					storeSessionData('user', JSON.stringify(respData.data));
					storeSessionData('userPower', JSON.stringify(respData.data.authInfos));
					storeSessionData('userToken',respData.data.token);
					window.top.location.href='/index.html';;
				}else{
					$.messager.alert('提示',respData.message);
				}
		};
		ajaxRequest(req);
    }
</script>
</HEAD>
<BODY>
<div id="login-window" class="easyui-window" title="登录" style="padding:5px;width:450px;height:250px" >
    <div class="easyui-layout" fit="true">
        <div region="center" border="false" style="padding:5px;background:#fff;border:1px solid #ccc;">
            <form  id="loginForm">
                <table>
                  <tr><td align="right">手机号:</td><td><input type="text" name="mobilephone"  value="13688045624" class="easyui-textbox" data-options="required:true,height:30,width:300" ></input></td></tr>
                  <tr><td align="right">密码:</td><td><input type="text" name="password"  value="123456"  class="easyui-passwordbox" data-options="required:true,height:30,width:300" ></input></td></tr>
                </table>
            </form>
        </div>
        <div region="south" border="false" style="text-align:right;padding:5px 0;">
                <a class="easyui-linkbutton" iconCls="icon-ok" href="javascript:void(0)" onclick="login()">登录</a>
                <a class="easyui-linkbutton" iconCls="icon-cancel" href="javascript:void(0)" onclick="cleardata()">重置</a>
        </div>
    </div>
</div>
</BODY>
</HTML>